//
//  Emotion.swift
//  AnimotionKeyboard
//
//  Created by xxy on 16/6/3.
//  Copyright © 2016年 xxy. All rights reserved.
//

import UIKit

class Emotion: NSObject {
/// 表情文字
    var chs: String?
    /// 表情图片文件名
    var png: String?
    /// emoji编码
    var code: String? {
        didSet {
            emoji = code?.emoji

        }
    }
      /// 完整的图像路径
    var imagePath: String {
        return png == nil ? "" : NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
    }
    /// emoji 字符串
    var emoji: String?
    /// 是否删除按钮
    var isRemoved = false
    /// 是否空白按钮
    var isEmpty = false
    

    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
     // MARK: - 构造函数
    init(dict: [String: AnyObject]) {
        super.init()
       setValuesForKeysWithDictionary(dict)
    }
    
    init(isRemoved: Bool) {
        self.isRemoved = isRemoved
    }
    init(isEmpty: Bool) {
    self.isEmpty = isEmpty
    }
    
    
    /// 描述
    override var description: String{
        let keys  = ["chs", "png", "code"]
        return dictionaryWithValuesForKeys(keys).description
    }
}
